"use strict";
(self["webpackChunktoknow"] = self["webpackChunktoknow"] || []).push([[979],{

/***/ 979:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ AuthorProfile)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./src/assets/image/ad3.png
var ad3 = __webpack_require__(2317);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/index/components/author/AuthorProfile.vue?vue&type=template&id=93090f7a&scoped=true




const _withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-93090f7a"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const _hoisted_1 = { class: "user-page-wrapper" }
const _hoisted_2 = { class: "user-info" }
const _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("div", { class: "user-help-cards" }, [
  /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("img", {
    src: ad3,
    alt: "Ad3"
  }),
  /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("div", { class: "authority" }, [
    /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("p", null, "ToKnow"),
    /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("p", null, "Copyright © 2022.ToKnow All rights reserved.")
  ])
], -1 /* HOISTED */))

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_author_base_info = (0,runtime_core_esm_bundler/* resolveComponent */.up)("author-base-info")
  const _component_author_data_info = (0,runtime_core_esm_bundler/* resolveComponent */.up)("author-data-info")
  const _component_router_view = (0,runtime_core_esm_bundler/* resolveComponent */.up)("router-view")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_2, [
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_author_base_info, {
        class: "author-base-info",
        author: $data.author_info,
        onFollow: $options.follow
      }, null, 8 /* PROPS */, ["author", "onFollow"]),
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_author_data_info, {
        class: "user-data-info",
        author: $data.author_info
      }, null, 8 /* PROPS */, ["author"])
    ]),
    (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_router_view, { class: "author-works" }),
    _hoisted_3
  ]))
}
;// CONCATENATED MODULE: ./src/pages/index/components/author/AuthorProfile.vue?vue&type=template&id=93090f7a&scoped=true

// EXTERNAL MODULE: ./src/pages/index/components/author/profile/AuthorBaseInfo.vue + 4 modules
var AuthorBaseInfo = __webpack_require__(3570);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(3577);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/index/components/author/profile/AuthorDataInfo.vue?vue&type=template&id=d6b157ee&scoped=true


const AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-d6b157ee"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_hoisted_1 = { class: "author-data-info" }
const AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_hoisted_2 = /*#__PURE__*/ AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h4", null, "Follow", -1 /* HOISTED */))
const AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_hoisted_3 = /*#__PURE__*/ AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h4", null, "Followed", -1 /* HOISTED */))
const _hoisted_4 = /*#__PURE__*/ AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h4", null, "Works", -1 /* HOISTED */))

function AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("ul", AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("li", null, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("h3", null, (0,shared_esm_bundler/* toDisplayString */.zw)($props.author.follow_times), 1 /* TEXT */),
      AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_hoisted_2
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("li", null, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("h3", null, (0,shared_esm_bundler/* toDisplayString */.zw)($props.author.followed_times), 1 /* TEXT */),
      AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_hoisted_3
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("li", null, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("h3", null, (0,shared_esm_bundler/* toDisplayString */.zw)($props.author.article_num + $props.author.source_num), 1 /* TEXT */),
      _hoisted_4
    ])
  ]))
}
;// CONCATENATED MODULE: ./src/pages/index/components/author/profile/AuthorDataInfo.vue?vue&type=template&id=d6b157ee&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/index/components/author/profile/AuthorDataInfo.vue?vue&type=script&lang=js

/* harmony default export */ const AuthorDataInfovue_type_script_lang_js = ({
  props: {
    author: {
      type: Object,
      default: () => {}
    }
  }
});

;// CONCATENATED MODULE: ./src/pages/index/components/author/profile/AuthorDataInfo.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/index/components/author/profile/AuthorDataInfo.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(AuthorDataInfovue_type_script_lang_js, [['render',AuthorDataInfovue_type_template_id_d6b157ee_scoped_true_render],['__scopeId',"data-v-d6b157ee"]])

/* harmony default export */ const AuthorDataInfo = (__exports__);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/index/components/author/AuthorProfile.vue?vue&type=script&lang=js




/* harmony default export */ const AuthorProfilevue_type_script_lang_js = ({
  components: {
    AuthorBaseInfo: AuthorBaseInfo/* default */.Z,
    AuthorDataInfo: AuthorDataInfo,
  },
  data() {
    return {
      author_id: "",
      author_info: {}
    }
  },
  methods: {
    fetchAuthorInfo() {
      this.$fetch({
        name: 'author info',
        url: 'author/info',
        method: 'POST',
        data: {
          author_id: this.author_id
        },
        callback: res => {
          if(res.data.success) {
            this.author_info = res.data.object;
            this.author_info.work_num = this.author_info.article_num + 
              this.author_info.source_num + this.author_info.column_num;
          }
        }
      })
    },
    follow() {
      this.$post({
        name: 'follow',
        url: 'author/follow',
        data: {
          author_id: this.author_id
        },
        callback: res => {
          if(res.data.success) {
            this.author_info.is_follow = !this.author_info.is_follow;
            this.$alert(res.data.message);
            this.$store.commit("fetchUserInfos");
          } else {
            this.$alert({
              type: 'error',
              content: res.data.message
            });
          }
        }
      })
    }
  },
  mounted () {
    console.log('author profile: ', this.$route);
    let params = this.$route.params;
    this.author_id = params.author_id;
    this.fetchAuthorInfo();
  },
});

;// CONCATENATED MODULE: ./src/pages/index/components/author/AuthorProfile.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/pages/index/components/author/AuthorProfile.vue




;


const AuthorProfile_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(AuthorProfilevue_type_script_lang_js, [['render',render],['__scopeId',"data-v-93090f7a"]])

/* harmony default export */ const AuthorProfile = (AuthorProfile_exports_);

/***/ }),

/***/ 3570:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ AuthorBaseInfo)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(3577);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/index/components/author/profile/AuthorBaseInfo.vue?vue&type=template&id=192cbd4c&scoped=true


const _withScopeId = n => (_pushScopeId("data-v-192cbd4c"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "author-base-info-wrapper" }
const _hoisted_2 = ["src", "alt"]
const _hoisted_3 = { class: "name-sign" }
const _hoisted_4 = { class: "name" }
const _hoisted_5 = { class: "sign" }

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("img", {
      src: _ctx.$baseURL + $props.author.avatar,
      alt: $data.authorName
    }, null, 8 /* PROPS */, _hoisted_2),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_3, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("h2", _hoisted_4, (0,shared_esm_bundler/* toDisplayString */.zw)($props.author.username), 1 /* TEXT */),
      (0,runtime_core_esm_bundler/* createElementVNode */._)("h3", _hoisted_5, (0,shared_esm_bundler/* toDisplayString */.zw)($props.author.sign || '这里什么也没有，这是个神秘的人~'), 1 /* TEXT */)
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
      class: "follow",
      onClick: _cache[0] || (_cache[0] = (...args) => ($options.follow && $options.follow(...args))),
      style: (0,shared_esm_bundler/* normalizeStyle */.j5)($options.buttonSty)
    }, (0,shared_esm_bundler/* toDisplayString */.zw)($options.ifFollowSign), 5 /* TEXT, STYLE */)
  ]))
}
;// CONCATENATED MODULE: ./src/pages/index/components/author/profile/AuthorBaseInfo.vue?vue&type=template&id=192cbd4c&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/index/components/author/profile/AuthorBaseInfo.vue?vue&type=script&lang=js

  /* harmony default export */ const AuthorBaseInfovue_type_script_lang_js = ({
    props: {
      author: {
        type: Object,
        default: () => {
          return {
            username: '江户川哀',
            avatar: '',
            sign: '理想是做出最棒的国产IDE',
          }
        }
      },
    },
    data() {
      return {
        authorName: 'xxxx'
      }
    },
    computed: {
      ifFollowSign() {
        return this.author.is_follow ? '已关注' : '关注' 
      },
      buttonSty() {
        if(this.author.is_follow) return {
          color: 'var(--blue)',
          border: '1px solid var(--lightBlue)'
        }
      }
    },
    methods: {
      follow() {
        this.$emit('follow');
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/index/components/author/profile/AuthorBaseInfo.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/index/components/author/profile/AuthorBaseInfo.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(AuthorBaseInfovue_type_script_lang_js, [['render',render],['__scopeId',"data-v-192cbd4c"]])

/* harmony default export */ const AuthorBaseInfo = (__exports__);

/***/ }),

/***/ 2317:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = __webpack_require__.p + "images/ad3.e7942.png";

/***/ })

}]);